package com.ymatou.iapi.coupon.testcase;

import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;



import org.apache.http.client.ClientProtocolException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.alibaba.druid.sql.ast.statement.SQLIfStatement.Else;
import com.google.common.collect.Lists;
import com.ymatou.iapi.activitymanage.parameter.returnProductActivityStockBean;
import com.ymatou.iapi.coupon.parameter.ActivityPriceDto;
import com.ymatou.iapi.coupon.parameter.BestCouponInfo;
import com.ymatou.iapi.coupon.parameter.GetProductAvailableCouponListBean;
import com.ymatou.iapi.coupon.parameter.GetProductBestCouponBean;
import com.ymatou.iapi.coupon.parameter.PlatformCouponInfo;
import com.ymatou.iapi.coupon.parameter.RuleDto;
import com.ymatou.iapi.coupon.parameter.SellerCouponInfo;
import com.ymatou.iapi.coupon.parameter.availableCoupon;
import com.ymatou.iapi.coupon.parameter.batchInfo;
import com.ymatou.iapi.coupon.parameter.batchInfos;
import com.ymatou.iapi.coupon.parameter.bestCoupon;
import com.ymatou.iapi.coupon.service.GetProductAvailableCouponListCall;
import com.ymatou.iapi.couponmanage.parameter.CreateCouponBean;
import com.ymatou.iapi.couponmanage.parameter.SellerCreateBatchBean;
import com.ymatou.iapi.couponmanage.service.CreateCouponCall;
import com.ymatou.iapi.couponmanage.service.SellerCreateBatchCall;
import com.ymatou.promotion.api.parameter.AvailableCouponInfo;
import com.ymt.base.YmatouEasyCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.CouponServiceCallServiceV2;
import com.ymttest.business.service.CouponServiceMCallServiceV2;
import com.ymttest.database.model.coupon;
import com.ymttest.database.model.couponbatch;
import com.ymttest.database.sqlwapper.couponWapper;
import com.ymttest.database.sqlwapper.couponbatchWapper;
import com.ymttest.utils.TestDataManager;
/**
*商详可用优惠券列表
*FreeMaker Template自动生成代码
*/
@TestSuite
@Ignore
public class Ts_GetProductAvailableCouponList{
	private static GetProductAvailableCouponListBean bean;
	private static GetProductAvailableCouponListCall call;
	
	private  SellerCreateBatchBean sellerCreateBatchBean=new SellerCreateBatchBean();
	private  SellerCreateBatchCall sellerCreateBatchCall=new SellerCreateBatchCall();
	
	
	private  CreateCouponBean createCouponBean;
	private  CreateCouponCall createCouponCall;
	private  couponWapper couponWapper=new couponWapper();
	private couponbatchWapper couponbatchWapper=new couponbatchWapper();
	
	private CouponServiceMCallServiceV2 couponMService=new CouponServiceMCallServiceV2();
	private CouponServiceCallServiceV2 couponService=new CouponServiceCallServiceV2();
	//平台券没有指定任何条件
	private final String ruleId_All="e0d889ac817a4c6ea9188baa4d909d11";
	private final Integer operatorId=222222; //操作人
	private final String batchCode="NUVGKT1CKX";
	//private final String all_title="验证多张券4000000_3900000-吴文专用";
	private final String all_title="所有用户均可用-吴文专用";
	//平台券指定商品
	private final String ruleId_productId="a740cf9fe22a46dc91c89c09c72e61cf";
	private final String batchCode_productId="9PWHYKALTN";
	private final String productId="productId999";
	private final String title_productId="指定商品productId999-吴文专用";
	//平台券指定类目
	private final String batchCode_categories="YJMGNSAD12";
	private final Integer categoriesId=1001;
	private final String ruleId_categoriesId="150e3e4dd51d4b73852878b3219df31f";
	private final String title_categories="指定类目1001-吴文专用";
	//平台券指定品牌
	private final String batchCode_brandId="UW4G6CL5K4";
	private final Integer brandId=500;
	private final String ruleId_brandId="66c69f29afba4b9bae8e1160c7828ba9";
	private final String title_brandId="指定品牌500-吴文专用";
	//平台券指定国家
	private final String batchCode_countryId="2Z6QLEQ5Q3";
	private final Integer countryId=10;
	private final String ruleId_countryId="a3e59ef735f64278a0c65093b6cf0503";
	private final String title_countryId="指定国家10-吴文专用";
	//平台券指定活动
	private final String batchCode_activityId="4Z819QC1N9";
	private final Integer activityId=11;
	private final String ruleId_activityId="0fd76c0ee8f9485eab75a2ec31f9327c";
	private final String title_activityId="指定活动11-吴文专用";
	//平台券指定psp
	private final String batchCode_isPsp="U5QFRZSAFF";
	private final boolean isPsp=true;
	private final String ruleId_isPsp="9873bbeb86ec4c18b5fdbe56af7023ce";
	private final String title_isPsp="指定是优选商品-吴文专用";
	//平台券指定使用团长券
	private final String batchCode_isGroup="CVHZTRMVEV";
	private final boolean isGroup=true;
	private final String ruleId_isGroup="ff31ec7e321a42a98c464ce397a24433";
	private final String title_isGroup="指定是使用团长券-吴文专用";
	//平台券指定platformSource=0 c2c
	private final String batchCode_platformSource0="GHY5S1WPA2";
	private final Integer platformSource0=0;
	private final String ruleId_platformSource0="b234a0e9b93644a6abd4578fe639b100";
	private final String title_platformSource0="指定platformSource=0-C2C-吴文专用";
	//平台券指定platformSource=1 全球优选
	private final String batchCode_platformSource1="LN7HLL8JJA";
	private final Integer platformSource1=1;
	private final String ruleId_platformSource1="920e28b0e3444582891bbedff0972a93";
	private final String title_platformSource1="指定platformSource=1-全球优选-吴文专用";
	//平台券设置每人可以领取2次
	private final String batchCode_receiveTimes2="V4XEHNTEWA";
	private final String ruleId_receiveTimes2="e3601aa38d71434b84cd1fa2ef97e1c1";
	private final String title_receiveTimes2="指定每人可领取2次-吴文专用";
	//规则中有两张券
	private final String ruleId_two_4000000_3800000="cf398958b8d34f3a8d6a493cd4baea69";
	private final String ruleId_two_4000000_3900000="b8a41cf48808412bb6f9e28d0ee85380";
	private final String ruleId_two_4000000_3700000="e95a71ee1d5d42e78d3c0c4635cc8840";
	private final String batchCode_two_4000000_3800000="3V294LCJKZ";//满4000000减3800000
	private final String batchCode_two_4000000_3900000="ELMX48LFHZ";//满4000000减3900000
	private final String batchCode_two_4000000_3700000="TFXLSYWE58";//满4000000减3700000
	private final String title_two_4000000_3800000="验证多张券4000000_3800000-吴文专用";
	private final String title_two_4000000_3900000="验证多张券4000000_3900000-吴文专用";
	private final String title_two_4000000_3700000="验证多张券4000000_3700000-吴文专用";
	
	//新人优惠券
	private final String batchCode_newUser="76ENJ46G8R";
	private final String title_newUser="新人专享大礼包";
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("商详可用优惠券列表(暂时不维护，汇总到总接口)");
	}

	@Before
	public void caseUp() {
		bean=new GetProductAvailableCouponListBean();
		call=new GetProductAvailableCouponListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	public void receiveCouponInfoByRule(Integer userId,String ruleId) throws ClientProtocolException, IOException
	{
		String deviceId="aaa"+TestDataManager.getRandomNum(5);
		String url="http://couponmarketingbiz.iapi.ymatou.com/api/couponmkting/ReceiveActivityCoupon";
		String str="{\"userId\":"+userId+",\"deviceId\":\""+deviceId+"\",\"activityname\":\""+ruleId+"\"}";
		YmatouEasyCall ec=new YmatouEasyCall(url, "POST", "JSON");
		ec.setData(str);
		ec.callService();
		String data=ec.getReturnData();
		System.out.print(data);
	}
	
	/**
	 * 
	 * @param ruleId 规则Id
	 * @return
	 */
	private GetProductAvailableCouponListBean initGetProductBestCoupon(Integer operatorId,String ruleId)
	{
		Integer buyerId=TestDataManager.getRandomIntNum(5);
		String productId="productId_"+TestDataManager.getRandomIntNum(5);
		bean.setBuyerId(buyerId);
		List<RuleDto> rules=new ArrayList();
		RuleDto ruleDto=new RuleDto();
		ruleDto.setRuleId(ruleId);//领券规则id（新人优惠券无规则ID）
		ruleDto.setMode(0);//0 = 平台优惠券 1=新人优惠券
		//2未下单会员,8已下单会员 32普通 64白银 128黄金 256铂金 512钻石 1024黑卡 2048非安利会员/大人 4096安利会员 8192安利达人 16黄牛
		ruleDto.setUserType(2);//用户身份
		rules.add(ruleDto);
		
		bean.setRules(rules);
		bean.setSellerId(operatorId);
		bean.setProductId(productId);
		
		List<Integer> categoryIds=new ArrayList();
		categoryIds.add(1001);
		categoryIds.add(1002);
		categoryIds.add(1003);
		bean.setCategoryIds(categoryIds);
		
		bean.setBrandId(200);
		//bean.setCountryId(10);
		bean.setPrice(new BigDecimal(70000000));
		
		bean.setMemberGrade(0);
		bean.setPsp(false);
		bean.setPlatformSource(0);//平台来源（0-C2C，1-全球优选)
		bean.setUseCommander(false);
		bean.setPlatformId(0);
		bean.setCouponUseType(0);//在活动上使用限制 0 无限制  1不可用买手券 2不可用平台券 3不可用买手券以及平台券
		
		return bean;
	}
	
	
	
	/**
	 * 验证都为空
	 */
	public BestCouponInfo check_empty()
	{
        Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
        Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
        
        BestCouponInfo resp=call.getProductAvailable();
        //Logger.verifyEquals(0, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
        
        return  resp;
	}
	
	
	/**
	 * 
	 * @param sellerbatchBean 买手券bean
	 * @param sellerbatchCall 买手券call
	 * @param createCouponBean 平台券bean
	 * @param createCouponCall 平台券call
	 * batchCode 用于平台
	 */
	private void check_verify( List<String> batchCodes,Integer createrType)
	{
		 Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
         Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
         BestCouponInfo resp=call.getProductAvailable();
         List<SellerCouponInfo> resp_sellers=resp.getSellerCouponInfoList();
         List<PlatformCouponInfo> resp_platforms=resp.getPlatformCouponInfoList();
         
         List<couponbatch> DB_batchs=couponbatchWapper.getCouponBatchByBatchCodes(batchCodes,createrType);
        
    	 Logger.comment("###########  验证sellerCouponInfoList ####################");
         for(int i=0;i<DB_batchs.size();i++)
         {
        	 couponbatch DB_batch=DB_batchs.get(i);
        	 List<coupon> coupons=couponWapper.selectByBatchIdAndUserId(DB_batchs.get(0).getBatchId(),bean.getBuyerId());
        	 if(createrType==2)//买手
             {
	        	 Logger.comment("##### BatchCode: #####"+DB_batchs.get(i).getBatchCode());

	        	 Logger.verifyEquals(DB_batch.getBatchCode(), resp_sellers.get(i).getBatchCode(), "验证买手返回的batchCode与数据库的一致");
	        	 Logger.verifyEquals(DB_batch.getCouponName(), resp_sellers.get(i).getCouponName(), "验证买手返回的CouponName与数据库的一致");
	        	 Logger.verifyEquals(DB_batch.getCouponValue().stripTrailingZeros().toPlainString(), resp_sellers.get(i).getDeductionAmount().stripTrailingZeros().toPlainString(), "验证买手返回的DeductionAmount与数据库的一致");
	        	 Logger.verifyEquals(DB_batch.getMinOrderValue().stripTrailingZeros().toPlainString(), resp_sellers.get(i).getMeetAmount().stripTrailingZeros().toPlainString(), "验证买手返回的MeetAmount与数据库的一致");
	        	  //是否领取
	        	 boolean receive=false;
	        	 if(DB_batch.getReceiveTimesPerUser()==2)
	        	 {
//	        		 if(coupons.size()>1) receive=false;
//	        		 else receive=true;
	        		 if(coupons.size()==0 || coupons.size()==1) receive=true;
	        		 else if(coupons.size()==2) receive=false;	 
	        	 }
	        	 else
	        	 {
	        		 if(coupons.size()>0) receive=false;
	        		 else receive=true;
	        	 }
	        	// Logger.verifyEquals(receive, resp_sellers.get(i).getNeedReceive(), "验证买手返回的NeedReceive与数据库的一致");
	        	 Logger.verifyEquals(receive, resp_sellers.get(i).getNeedReceive(), "验证买手返回的NeedReceive与数据库的一致");
             }
        	 if(createrType==1)//平台
             {
        		 PlatformCouponInfo resp_platform=resp_platforms.get(i);
        		 Logger.comment("###########  验证platformCouponInfoList ####################");
            	 Logger.verifyEquals( resp_platform.getBatchInfos().get(0).getNeedReceive()==false?null:bean.getRules().get(0).getRuleId(), resp_platform.getRuleId(), "验证平台返回的ruleId");
            	 Logger.verifyEquals( bean.getRules().get(0).getMode(), resp_platform.getMode(), "验证平台返回的Mode");

            	 //startTime
            	 //endTime
            	 List<batchInfo> resp_batchs=resp_platform.getBatchInfos();
            	 for(int k=0;k<resp_batchs.size();k++)
            	 {
            		 // Logger.verifyEquals(DB_batch.getBatchCode(), resp_batchs.get(k).getBatchCode(), "验证返回的batchCode与数据库的一致");
    	        	 Logger.verifyEquals(DB_batch.getCouponName(), resp_batchs.get(k).getCouponName(), "验证平台返回的CouponName与数据库的一致");
    	        	 Logger.verifyEquals(DB_batch.getCouponValue().stripTrailingZeros().toPlainString(), resp_batchs.get(k).getDeductionAmount().stripTrailingZeros().toPlainString(), "验证平台返回的DeductionAmount与数据库的一致");
    	        	 Logger.verifyEquals(DB_batch.getMinOrderValue().stripTrailingZeros().toPlainString(), resp_batchs.get(k).getMeetAmount().stripTrailingZeros().toPlainString(), "验证平台返回的MeetAmount与数据库的一致");
    	        	 
    	        	 Logger.verifyEquals(DB_batch.getEffectiveTimeType(), resp_batchs.get(k).getEffectiveType(), "验证平台返回的EffectiveTimeType与数据库的一致");
    	        	 Logger.verifyEquals(DB_batch.getEffectiveDays(), resp_batchs.get(k).getEffectiveDays(), "验证平台返回的EffectiveDays与数据库的一致");
    	        	 
    	        	// Logger.verifyEquals(resp_platform.getRuleId()==null?false:true, resp_batchs.get(i).getNeedReceive(), "验证平台返回的NeedReceive与数据库的一致");
    	        	  //是否领取
    	        	 boolean receive=false;
    	        	 if(DB_batch.getReceiveTimesPerUser()==2)
    	        	 {
//    	        		 if(coupons.size()>1) receive=false;
//    	        		 else receive=true;
    	        		 if(coupons.size()==0 || coupons.size()==1) receive=true;
    	        		 else if(coupons.size()==2) receive=false;	 
    	        	 }
    	        	 else
    	        	 {
    	        		 if(coupons.size()>0) receive=false;
    	        		 else receive=true;
    	        	 }
    	        	// Logger.verifyEquals(receive, resp_platform.getNeedReceive(), "验证平台返回的NeedReceive");
    	        	 Logger.verifyEquals(receive, resp_platform.getBatchInfos().get(k).getNeedReceive(), "验证平台返回的NeedReceive");
            	 }
            	 Logger.verifyEquals(resp_platform.getRuleId()!=null?getTitleName(batchCodes.get(0)):null, resp_platform.getTitle(), "验证平台返回的Title");
             }
         } 
	}
	public String getTitleName(String batchCode)
	{
		String title="";
		if(batchCode.equals(batchCode_productId)) title=this.title_productId;
		else if(batchCode.equals(batchCode_categories)) title=this.title_categories;
		else if(batchCode.equals(batchCode_brandId)) title=this.title_brandId;
		else if(batchCode.equals(batchCode_countryId)) title=this.title_countryId;
		else if(batchCode.equals(batchCode_activityId)) title=this.title_activityId;
		else if(batchCode.equals(batchCode_isPsp)) title=this.title_isPsp;
		else if(batchCode.equals(batchCode_isGroup)) title=this.title_isGroup;
		else if(batchCode.equals(batchCode_platformSource0)) title=this.title_platformSource0;
		else if(batchCode.equals(batchCode_platformSource1)) title=this.title_platformSource1;
		else if(batchCode.equals(batchCode_receiveTimes2)) title=this.title_receiveTimes2;
		else if(batchCode.equals(ruleId_two_4000000_3800000)) title=this.title_two_4000000_3800000;
		else if(batchCode.equals(batchCode_two_4000000_3900000)) title=this.title_two_4000000_3900000;
		else if(batchCode.equals(batchCode_two_4000000_3700000)) title=this.title_two_4000000_3700000;
		else if(batchCode.equals(this.batchCode_newUser)) title=this.title_newUser;
		else title=all_title;
		return title;
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_001() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-未领取满足条件的优惠券批次-返回成功");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
//			//领取2买手
//			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();		
			
			check_verify( Lists.newArrayList(this.batchCode_two_4000000_3900000),1);
			check_verify( Lists.newArrayList(sellerCreateBatchCall2.getBatchCode(),sellerCreateBatchCall1.getBatchCode()),2);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_002() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-已领取不满足条件的优惠券批次-返回成功(20200710修改 不验证门槛)");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,"");
			bean.setPrice(new BigDecimal(1));
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
			//领取2买手
			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			//领取平台
			this.receiveCouponInfoByRule(userId, this.ruleId_two_4000000_3900000);
			
			call.setData(bean);
			call.callService();		
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(2, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			Logger.verifyEquals(1, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_003() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-已领取满足条件的优惠券批次-返回成功");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,"");
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
			//领取1 2买手
			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			//平台
			this.receiveCouponInfoByRule(userId, this.ruleId_two_4000000_3900000);
			
			call.setData(bean);
			call.callService();				
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(2, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			Logger.verifyEquals(1, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");
			
			check_verify( Lists.newArrayList(sellerCreateBatchCall2.getBatchCode(),sellerCreateBatchCall1.getBatchCode()),2);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_004() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-未领取满足条件的优惠券批次,已过期-返回成功");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
//			//领取2买手
//			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			//设置 使用时间开始时间小于当前时间
			//平台
			couponbatchWapper.setAcquireStartTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(1).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(2).atZone(ZoneId.systemDefault()).toInstant())));
			//买手1
			couponbatchWapper.setAcquireStartTime(sellerCreateBatchCall1.getBatchCode(), Date.from((LocalDateTime.now().plusDays(1).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(sellerCreateBatchCall1.getBatchCode(), Date.from((LocalDateTime.now().plusDays(2).atZone(ZoneId.systemDefault()).toInstant())));
			//买手2
			couponbatchWapper.setAcquireStartTime(sellerCreateBatchCall2.getBatchCode(), Date.from((LocalDateTime.now().plusDays(1).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(sellerCreateBatchCall2.getBatchCode(), Date.from((LocalDateTime.now().plusDays(2).atZone(ZoneId.systemDefault()).toInstant())));

			call.setData(bean);
			call.callService();			
			//设置 不过期
			couponbatchWapper.setAcquireStartTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(-2).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(40).atZone(ZoneId.systemDefault()).toInstant())));
			
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(0, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			Logger.verifyEquals(0, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_005() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-未领取满足条件的优惠券批次,已删除-返回失败");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,"");
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
//			//领取2买手
//			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			//设置 使用时间开始时间小于当前时间
			//平台
			couponbatchWapper.setIsInvalid(batchCode_two_4000000_3900000);
			couponbatchWapper.setIsInvalid(sellerCreateBatchCall1.getBatchCode());
			couponbatchWapper.setIsInvalid(sellerCreateBatchCall2.getBatchCode());

			call.setData(bean);
			call.callService();			
			//设置 
			couponbatchWapper.setNoInvalid(batchCode_two_4000000_3900000);
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(0, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			Logger.verifyEquals(0, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_006() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-未领取不满足条件的优惠券批次-返回成功(20200710修改 不验证门槛)");
		try {
			bean=initGetProductBestCoupon(this.operatorId,"");
			bean.setPrice(new BigDecimal(1));
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
//			//领取2买手
//			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
//			//领取平台
//			this.receiveCouponInfoByRule(userId, this.ruleId_two_4000000_3900000);
			
			call.setData(bean);
			call.callService();		
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(2, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			Logger.verifyEquals(0, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_007() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-批次只能领取1次-已领取-返回失败");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,"");
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//领取平台
			this.receiveCouponInfoByRule(userId, this.ruleId_two_4000000_3900000);
			
			call.setData(bean);
			call.callService();		
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(0, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			Logger.verifyEquals(1, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");	
			check_verify( Lists.newArrayList(this.batchCode_two_4000000_3900000),1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_008() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-买手批次能领取2次-已领取1次-返回成功");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_receiveTimes2);
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			
			//买手优惠券
			sellerCreateBatchBean=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean.setSellerId(sellerId);
			sellerCreateBatchBean.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean.setReceiveNumPerUser(2);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean);
			
			//领取平台
			this.receiveCouponInfoByRule(userId, this.ruleId_receiveTimes2);
			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();				
			
			check_verify( Lists.newArrayList(this.batchCode_receiveTimes2),1);
			check_verify( Lists.newArrayList(sellerCreateBatchCall1.getBatchCode()),2);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_008_1() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-平台可领取2次-已领取2次-返回成功");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,"");
			Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			
			//买手优惠券
			sellerCreateBatchBean=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean.setSellerId(sellerId);
			sellerCreateBatchBean.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean.setReceiveNumPerUser(2);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean);
			
			//领取平台
			this.receiveCouponInfoByRule(userId, this.ruleId_receiveTimes2);
			this.receiveCouponInfoByRule(userId, this.ruleId_receiveTimes2);
			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();				
			
			check_verify( Lists.newArrayList(this.batchCode_receiveTimes2),1);
			check_verify( Lists.newArrayList(sellerCreateBatchCall1.getBatchCode()),2);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_009() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定新人优惠券-与返回成功");
		try {
			bean=initGetProductBestCoupon(this.operatorId,"");
			bean.getRules().get(0).setMode(1);//0 = 平台优惠券   1 = 新人优惠券
			bean.getRules().get(0).setUserType(1000);//1000黄牛券 1001新人首次 A券 1002新人第二次A券
            //领取
			//couponMService.receiveCouponInfo(this.batchCode, bean.getBuyerId());
			bean.setPrice(new BigDecimal(4000000));
			call.setData(bean);
			call.callService();		
			
			check_verify( Lists.newArrayList(this.batchCode_newUser),1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_010() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定非新人优惠券(平台优惠券)-返回失败");
		try {
			bean=initGetProductBestCoupon(this.operatorId,"");
			bean.getRules().get(0).setMode(0);//0 = 平台优惠券   1 = 新人优惠券
			bean.getRules().get(0).setUserType(1000);//1000黄牛券 1001新人首次 A券 1002新人第二次A券
            //领取
			//couponMService.receiveCouponInfo(this.batchCode, bean.getBuyerId());
			bean.setPrice(new BigDecimal(4000000));
			call.setData(bean);
			call.callService();			
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(0, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			Logger.verifyEquals(0, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	@org.junit.Ignore
	public void Tc_GetProductAvailableCouponList_011() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定买手Id-与传入的一致-返回成功");
		try {
			//bean=initGetProductBestCoupon(this.operatorId,this.rule);
			org.junit.Assert.fail();
			call.setData(bean);
			call.callService();			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	@org.junit.Ignore
	public void Tc_GetProductAvailableCouponList_012() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定买手Id-与传入的不一致-返回失败");
		try {
			//TODO 补全case代码
			org.junit.Assert.fail();
			call.setData(bean);
			call.callService();			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_013() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定商品Id-与传入的一致-返回成功");
		try {
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_productId);
			bean.setPrice(new BigDecimal(3000000));
			bean.setProductId(this.productId);
			call.setData(bean);
			call.callService();			
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(0, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			
			check_verify( Lists.newArrayList(this.batchCode_productId),1);

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_014() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定商品Id-与传入的不一致-返回失败");
		try {
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_productId);
			bean.setPrice(new BigDecimal(3000000));
			bean.setProductId(this.productId+1);
			call.setData(bean);
			call.callService();			
			
			BestCouponInfo resp=this.check_empty();
		Logger.verifyEquals(0, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
		Logger.verifyEquals(0, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");
		
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_015() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定活动-与传入的一致-返回成功");
		try {
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_activityId);

			bean.setActivityId(this.activityId);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			check_verify( Lists.newArrayList(this.batchCode_activityId),1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_016() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定活动-与传入的不一致-返回失败");
		try {
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_activityId);

			bean.setActivityId(this.activityId+1);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			BestCouponInfo resp=this.check_empty();
			Logger.verifyEquals(0, resp.getSellerCouponInfoList().size(), "验证sellerCouponInfoList为空");
			Logger.verifyEquals(0, resp.getPlatformCouponInfoList().size(), "验证platformCouponInfoList为空");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_017() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定类目Id-与传入的一致-返回成功");
		try {
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_categoriesId);

			List<Integer> categoryIds=new ArrayList();
			categoryIds.add(this.categoriesId);
			categoryIds.add(1002);
			categoryIds.add(1003);
			bean.setCategoryIds(categoryIds);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			check_verify( Lists.newArrayList(this.batchCode_categories),1);	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_018() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定类目Id-与传入的不一致-返回失败");
		try {
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_categoriesId);

			List<Integer> categoryIds=new ArrayList();
			categoryIds.add(this.categoriesId+1);
			categoryIds.add(1002);
			categoryIds.add(1003);
			bean.setCategoryIds(categoryIds);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			this.check_empty();	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_019() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定品牌与传入的一致-返回成功");
		try {
			
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_brandId);

			bean.setBrandId(this.brandId);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			check_verify( Lists.newArrayList(this.batchCode_brandId),1);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_020() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定品牌-与传入的不一致-返回失败");
		try {
			
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_brandId);

			bean.setBrandId(this.brandId+1);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			this.check_empty();	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_021() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定国家与传入的一致-返回成功");
		try {
			
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_countryId);

			bean.setCountryId(this.countryId);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			check_verify( Lists.newArrayList(this.batchCode_countryId),1);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_022() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定国家-与传入的不一致-返回失败");
		try {
			
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_countryId);

			bean.setCountryId(this.countryId+1);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			this.check_empty();		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_023() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定优选商品与传入的一致-返回成功");
		try {
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_productId);

			bean.setProductId(this.productId);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			check_verify( Lists.newArrayList(this.batchCode_productId),1);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_024() {
		Logger.start(true,"商详可用优惠券列表-平台券-未领取指定优选商品-与传入的不一致-返回失败");
		try {
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_productId);

			bean.setProductId(this.productId+1);
			//领取
			//this.receiveCouponInfoByRule(bean.getBuyerId(),this.ruleId_activityId);
			call.setData(bean);
			call.callService();			
			
			this.check_empty();		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_025() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空-返回所有的优惠券");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
			
//			//创建平台
//			CreateCouponBean createCouponBean=couponMService.setDefaultPlatformCreateCouponBeanForRecieve();
//			couponMService.createPlatformCoupon(createCouponBean);
//			//领取2买手
//			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), userId);
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();		
			
			check_verify( Lists.newArrayList(this.batchCode_two_4000000_3900000),1);
			check_verify( Lists.newArrayList(sellerCreateBatchCall1.getBatchCode(),sellerCreateBatchCall2.getBatchCode()),2);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_026() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,买手优惠券领取完-返回所有的优惠券");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
//			//领取2买手
			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), Integer.parseInt(TestDataManager.getRandomNum(5)));
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();		
			
			check_verify( Lists.newArrayList(this.batchCode_two_4000000_3900000),1);
			check_verify( Lists.newArrayList(sellerCreateBatchCall2.getBatchCode()),2);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_027() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,平台优惠券领取完-返回所有的优惠券");
		try {
			
			couponbatchWapper.setReceivedCount(this.batchCode, 999999999);
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_All);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//买手优惠券2
			SellerCreateBatchBean sellerCreateBatchBean2=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean2.setSellerId(sellerId);
			sellerCreateBatchBean2.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean2.setCouponAmount(new BigDecimal(3700000));
			SellerCreateBatchCall sellerCreateBatchCall2=couponMService.SellerCreateBatch(sellerCreateBatchBean2);
			
//			//领取2买手
		//	couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), Integer.parseInt(TestDataManager.getRandomNum(5)));
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();		
			couponbatchWapper.setReceivedCount(this.batchCode, 0);
		//	check_verify( Lists.newArrayList(this.batchCode_two_4000000_3900000),1);
			check_verify( Lists.newArrayList(sellerCreateBatchCall1.getBatchCode(),sellerCreateBatchCall2.getBatchCode()),2);
			
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_028() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,买手和平台优惠券都领取完-返回空");
		try {
			
			couponbatchWapper.setReceivedCount(this.batchCode, 999999999);
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_All);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			
//			//领取2买手
			couponMService.receiveCouponInfo(sellerCreateBatchCall1.getBatchCode(), Integer.parseInt(TestDataManager.getRandomNum(5)));
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();		
			couponbatchWapper.setReceivedCount(this.batchCode, 0);
			
			Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
	        Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
	        BestCouponInfo resp=call.getProductAvailable();
	        List<SellerCouponInfo> resp_sellers=resp.getSellerCouponInfoList();
	        List<PlatformCouponInfo> resp_platforms=resp.getPlatformCouponInfoList();
	        Logger.verifyEquals(0, resp_sellers.size(), "验证买手优惠券为空");
	        Logger.verifyEquals(0, resp_platforms.size(), "验证平台优惠券为空");
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_029() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,买手优惠券过期-返回买手优惠券为空");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_All);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			
			//买手1
			couponbatchWapper.setAcquireStartTime(sellerCreateBatchCall1.getBatchCode(), Date.from((LocalDateTime.now().plusDays(1).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(sellerCreateBatchCall1.getBatchCode(), Date.from((LocalDateTime.now().plusDays(2).atZone(ZoneId.systemDefault()).toInstant())));
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();		
			
			Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
	        Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
	        BestCouponInfo resp=call.getProductAvailable();
	        List<SellerCouponInfo> resp_sellers=resp.getSellerCouponInfoList();
	        Logger.verifyEquals(0, resp_sellers.size(), "验证买手优惠券为空");
	        
	        check_verify( Lists.newArrayList(this.batchCode),1);
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_030() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,平台优惠券过期-返回平台优惠券为空");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			
			//平台
			couponbatchWapper.setAcquireStartTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(1).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(2).atZone(ZoneId.systemDefault()).toInstant())));
//			couponMService.receiveCouponInfo(sellerCreateBatchCall2.getBatchCode(), userId);
			
			call.setData(bean);
			call.callService();		
			
			//设置 不过期
			couponbatchWapper.setAcquireStartTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(-2).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(40).atZone(ZoneId.systemDefault()).toInstant())));
			
			Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
	        Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
	        BestCouponInfo resp=call.getProductAvailable();
	        List<SellerCouponInfo> resp_sellers=resp.getSellerCouponInfoList();
	        List<PlatformCouponInfo> resp_platforms=resp.getPlatformCouponInfoList();
	        Logger.verifyEquals(1, resp_sellers.size(), "验证买手优惠券不为空");
	        Logger.verifyEquals(0, resp_platforms.size(), "验证平台优惠券为空");
	        
			check_verify( Lists.newArrayList(sellerCreateBatchCall1.getBatchCode()),2);
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_031() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,平台和买手领取优惠券都过期-返回平台和买手优惠券都为空");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			
			//平台
			couponbatchWapper.setAcquireStartTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(1).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(2).atZone(ZoneId.systemDefault()).toInstant())));
			//买手1
			couponbatchWapper.setAcquireStartTime(sellerCreateBatchCall1.getBatchCode(), Date.from((LocalDateTime.now().plusDays(1).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(sellerCreateBatchCall1.getBatchCode(), Date.from((LocalDateTime.now().plusDays(2).atZone(ZoneId.systemDefault()).toInstant())));
			
			call.setData(bean);
			call.callService();		
			
			//设置 不过期
			couponbatchWapper.setAcquireStartTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(-2).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setAcquireEndTime(this.batchCode_two_4000000_3900000, Date.from((LocalDateTime.now().plusDays(40).atZone(ZoneId.systemDefault()).toInstant())));
			
			Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
	        Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
	        BestCouponInfo resp=call.getProductAvailable();
	        List<SellerCouponInfo> resp_sellers=resp.getSellerCouponInfoList();
	        List<PlatformCouponInfo> resp_platforms=resp.getPlatformCouponInfoList();
	        Logger.verifyEquals(0, resp_sellers.size(), "验证买手优惠券不为空");
	        Logger.verifyEquals(0, resp_platforms.size(), "验证平台优惠券为空");
	        
		//	check_verify( Lists.newArrayList(sellerCreateBatchCall1.getBatchCode()),2);
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_031_1() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,平台和买手优惠券有效期过期-返回平台和买手优惠券都显示");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			
			//买手1
			//查询
			couponbatch batch=couponbatchWapper.selectBybatchCode(sellerCreateBatchCall1.getBatchCode()).get(0);
			couponbatchWapper.setValidStart(batch.getBatchId(), Date.from((LocalDateTime.now().plusDays(1).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setValidEnd(batch.getBatchId(), Date.from((LocalDateTime.now().plusDays(2).atZone(ZoneId.systemDefault()).toInstant())));
			
			call.setData(bean);
			call.callService();		
			
			//设置 不过期
			couponbatchWapper.setValidStart(batch.getBatchId(), Date.from((LocalDateTime.now().plusDays(-2).atZone(ZoneId.systemDefault()).toInstant())));
			couponbatchWapper.setValidEnd(batch.getBatchId(), Date.from((LocalDateTime.now().plusDays(40).atZone(ZoneId.systemDefault()).toInstant())));
			
			Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
	        Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
	        BestCouponInfo resp=call.getProductAvailable();
	        List<SellerCouponInfo> resp_sellers=resp.getSellerCouponInfoList();
	        List<PlatformCouponInfo> resp_platforms=resp.getPlatformCouponInfoList();
	        Logger.verifyEquals(1, resp_sellers.size(), "验证买手优惠券不为空");
	        Logger.verifyEquals(1, resp_platforms.size(), "验证平台优惠券不为空");
	        
		//	check_verify( Lists.newArrayList(sellerCreateBatchCall1.getBatchCode()),2);
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_032() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,买手优惠券作废-返回买手优惠券都为空");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//作废
			couponbatchWapper.setIsInvalid(sellerCreateBatchCall1.getBatchCode());
			call.setData(bean);
			call.callService();		
			//取消作废
			couponbatchWapper.setNoInvalid(sellerCreateBatchCall1.getBatchCode());
			
			Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
	        Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
	        BestCouponInfo resp=call.getProductAvailable();
	        List<SellerCouponInfo> resp_sellers=resp.getSellerCouponInfoList();
	        List<PlatformCouponInfo> resp_platforms=resp.getPlatformCouponInfoList();
	        Logger.verifyEquals(0, resp_sellers.size(), "验证买手优惠券不为空");
	        Logger.verifyEquals(1, resp_platforms.size(), "验证平台优惠券为空");
	        
	        check_verify( Lists.newArrayList(this.batchCode_two_4000000_3900000),1);
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductAvailableCouponList_033() {
		Logger.start(true,"商详可用优惠券列表-买手券和平台券-buyerId为空,平台优惠券作废-返回买手优惠券都为空");
		try {
			//平台优惠券
			bean=initGetProductBestCoupon(this.operatorId,this.ruleId_two_4000000_3900000);
			bean.setBuyerId(null);
		//	bean.setRules(null);
			//Integer userId=bean.getBuyerId();
			Integer sellerId=TestDataManager.getRandomIntNum(10);
			bean.setSellerId(sellerId);
			//买手优惠券1
			SellerCreateBatchBean sellerCreateBatchBean1=couponMService.setDefaultSellerCreateBatchBean();
			sellerCreateBatchBean1.setSellerId(sellerId);
			sellerCreateBatchBean1.setOrderMinAmount(new BigDecimal(4000000));
			sellerCreateBatchBean1.setCouponAmount(new BigDecimal(3600000));
			sellerCreateBatchBean1.setCouponTotalCount(1);
			SellerCreateBatchCall sellerCreateBatchCall1=couponMService.SellerCreateBatch(sellerCreateBatchBean1);
			//作废
			couponbatchWapper.setIsInvalid(this.batchCode_two_4000000_3900000);
			call.setData(bean);
			call.callService();		
			//取消作废
			couponbatchWapper.setNoInvalid(this.batchCode_two_4000000_3900000);
			
			Logger.verifyEquals("0", call.getStatusCode1(), "验证返回Code");
	        Logger.verifyEquals("操作成功！",call.getMessage(), "验证返回Message");
	        BestCouponInfo resp=call.getProductAvailable();
	        List<SellerCouponInfo> resp_sellers=resp.getSellerCouponInfoList();
	        List<PlatformCouponInfo> resp_platforms=resp.getPlatformCouponInfoList();
	        Logger.verifyEquals(1, resp_sellers.size(), "验证买手优惠券不为空");
	        Logger.verifyEquals(0, resp_platforms.size(), "验证平台优惠券为空");
	        
			check_verify( Lists.newArrayList(sellerCreateBatchCall1.getBatchCode()),2);
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}